<?php
session_start();
define('HH','http://'.$_SERVER['HTTP_HOST'].'/');
define('HT',HH.'admin/template/');

require 'inc/fun.php';
require 'inc/admin_fun.php';
require 'inc/admin_action.php';

$nav=$_SERVER['REQUEST_URI'];
$script=$_SERVER['SCRIPT_NAME'];
$nav=str_replace($script,'',$nav);
$vars=explode("/",substr($nav,1));

if(!empty($vars[0])&&!empty($vars[1])){
	$action = $vars[0];
	$method = $vars[1];
	$act = loadAdmin($action);
	$param = '';
	for($i=2;$i<sizeof($vars);$i++){
		$param .=',$vars['.$i.']';
	}
	$param = substr($param,1);
	eval('$act->$method('.$param.');');
}else{
	$welcome = loadAdmin('admin');
	$welcome->index();
}